#ifndef hal_position_H
#define hal_position_H

#include <stdint.h>
#include <cfg_param.h>

typedef struct
{
    uint32_t Position[MOTOR_MAX_ERROR_CHANNEL][MOTOR_MAX_NUM];
    uint32_t StepState[MOTOR_MAX_ERROR_CHANNEL][MOTOR_MAX_NUM];
    uint32_t Direction[MOTOR_MAX_ERROR_CHANNEL][MOTOR_MAX_NUM];
    uint32_t StepNumber[MOTOR_MAX_ERROR_CHANNEL][MOTOR_MAX_NUM];
} MotorInformSt;

void hal_PositionWrite(uint8_t groupid, uint8_t motor_num, uint32_t position);
uint32_t hal_PositionRead(uint8_t groupid, uint8_t motor_num);

void hal_StepStateWrite(uint8_t groupid, uint8_t motor_num, uint32_t stepstate);
uint32_t hal_StepStateRead(uint8_t groupid, uint8_t motor_num);

void hal_DirectionWeite(uint8_t groupid, uint8_t motor_num, uint32_t direction);
uint32_t hal_DirectionRead(uint8_t groupid, uint8_t motor_num);

void hal_StepNumberWrite(uint8_t groupid, uint8_t motor_num, uint32_t stepnumber);
uint32_t hal_StepNumberRead(uint8_t groupid, uint8_t motor_num);

uint8_t hal_MotorNumRead(uint8_t groupid);
void hal_MotorNumWrite(uint8_t groupid, uint8_t motor_num);
void hal_MotorNumReset();

#endif
